home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6367 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  48 lines

  1. Path: ix.netcom.com!netnews
  2. From: "Gary A. Fleming" <gfleming@ix.netcom.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: OWL 2.00 Programmers - Help with direct TBitmap construction please
  5. Date: Sat, 10 Feb 1996 00:47:10 -0500
  6. Organization: Netcom
  7. Message-ID: <311C315E.1947@ix.netcom.com>
  8. NNTP-Posting-Host: ix-nor-va3-21.ix.netcom.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=iso-8859-1
  11. Content-Transfer-Encoding: 8bit
  12. X-NETCOM-Date: Fri Feb 09  9:46:00 PM PST 1996
  13. X-Mailer: Mozilla 2.0b6a (Win95; I)
  14. CC: gfleming@ix.netcom.com
  15.  
  16. Dear Netters:
  17.  
  18. A simple question for you OWL 2.00 programmers. I have a 512 x 512 
  19. unsigned character array in local memory that I would like to display as 
  20. a 256 color bitmap in a frame control placed in a dialog box.  I am 
  21. running Borland C++ 4.0 and am trying to construct and display the 
  22. bitmap by constructing a TBitmap directly.  I have had success in 
  23. reading *.bmpÆs from disk and displaying those, but have had no success 
  24. in direct construction of a Tbitmap.   I am using the following steps in 
  25. attempt to construct my bitmap image:
  26.  
  27. 1.  Allocate variables and pointers
  28. 2.  Bitmap=new Tbitmap(512,512,1,8,data)  where data=unsigned char 
  29. [262144] (262144=512x512)
  30. 3.  Construct a TPalette object from a 256 entry PALETTEENTRY array of 
  31. RGB values
  32. 4.  Construct a TMemoryDC object and select the Bitmap using 
  33. SelectObject(Bitmap)
  34. 5.  Realize the palette for the memorydc
  35. 6.  Create the dialog box and frame control
  36. 7.  Create a source DC from the dialog box and select the frame control 
  37. using SelectObject(frame_control)
  38. 8.  Realize the palette for the sourceDC
  39. 9.  Perform a sourceDC->BitBlt(width,height,*memorydc,0,0,SRCCOPY)
  40.  
  41. After performing these steps, no image is displayed in the frame control 
  42. (or anywhere else for that matter).  What steps am I missing?
  43.  
  44. Any help would be appreciated.  Thanks in advance,
  45.  
  46. Gary Fleming
  47. gfleming@ix.netcom.com
  48.